package com.cxyjy.cfyuiapi.service.impl;

import com.cxyjy.cfyuiapi.service.HomeService;
import com.cxyjy.common.util.JObjectUtil;
import com.cxyjy.common.util.JResponse;
import com.cxyjy.common.util.ResultUtil;
import org.springframework.stereotype.Service;

import static com.cxyjy.common.constants.CfyuiConstants.VERIFICATION_CODE;
import static com.cxyjy.common.util.ResultCode.GET_EMPTY_VERIFICATION_CODE;
import static com.cxyjy.common.util.ResultCode.GET_WRONG_VERIFICATION_CODE;

/**
 * @Author: jony
 * @Date : 2024/12/3 08:52
 * @VERSION v1.0
 */
@Service("HomeService")
public class HomeServiceImpl implements HomeService {
    @Override
    public JResponse checkVerificationCode(String verificationCode) {
        if (JObjectUtil.isEmpty(verificationCode)) {
            return ResultUtil.error(GET_EMPTY_VERIFICATION_CODE);
        }
        if (verificationCode.equals(VERIFICATION_CODE)) {
            return ResultUtil.justSuccess();
        }
        return ResultUtil.error(GET_WRONG_VERIFICATION_CODE);
    }
}
